package com.example.hello.mapstruct.service;

import com.example.hello.mapstruct.convertor.ObjectConvertor;
import com.example.hello.mapstruct.pojo.Boy;
import com.example.hello.mapstruct.pojo.Man;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName: MapStructService
 * @Description:
 * @Author: 12071
 * @Date: 2022/6/29 16:56
 */
@Service
public class MapStructService {
    @Autowired
    ObjectConvertor objectConvertor;

    public void objConvert() {
        Boy boy = new Boy("zang", 18, "zjut", "zang.gold");
        System.out.println(boy);
        Man man = objectConvertor.boy2Man(boy);
        System.out.println("After convert: ");
        System.out.println(man);
    }
}
